home *** CD-ROM | disk | FTP | other *** search
/ Super PC 34 / Super PC 34 (Shareware).iso / spc / UTIL / DJGPP2 / V2 / DJDEV200.ZIP / include / sys / fsext.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-25  |  1.5 KB  |  58 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #ifndef __dj_include_sys_fsext_h_
  3. #define __dj_include_sys_fsext_h_
  4.  
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8.  
  9. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  10.  
  11. #ifndef __STRICT_ANSI__
  12.  
  13. #ifndef _POSIX_SOURCE
  14.  
  15. #include <stdarg.h>
  16.  
  17. typedef enum {
  18.   __FSEXT_nop,
  19.   __FSEXT_open,
  20.   __FSEXT_creat,
  21.   __FSEXT_read,
  22.   __FSEXT_write,
  23.   __FSEXT_ready,
  24.   __FSEXT_close,
  25. } __FSEXT_Fnumber;
  26.  
  27. /* _ready gets passed a fd and should return a mask of these,
  28.    as if we were emulating "int ready(int fd)" */
  29. #define __FSEXT_ready_read    1
  30. #define __FSEXT_ready_write    2
  31. #define __FSEXT_ready_error    4
  32.  
  33. /* The return value is nonzero if the function has overridden the
  34.    caller's functionality. */
  35. typedef int (__FSEXT_Function)(__FSEXT_Fnumber _function_number,
  36.                    int *_rv, va_list _args);
  37.  
  38. int               __FSEXT_alloc_fd(__FSEXT_Function *_function);
  39. int               __FSEXT_set_function(int _fd, __FSEXT_Function *_function);
  40. __FSEXT_Function *__FSEXT_get_function(int _fd);
  41.  
  42. int               __FSEXT_add_open_handler(__FSEXT_Function *_function);
  43. int               __FSEXT_call_open_handlers(__FSEXT_Fnumber _function_number,
  44.                          int *rv, va_list _args);
  45.  
  46. #endif /* !_POSIX_SOURCE */
  47. #endif /* !__STRICT_ANSI__ */
  48. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  49.  
  50. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  51. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  52.  
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56.  
  57. #endif /* !__dj_include_sys_fsext_h_ */
  58.